<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />

  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>Generating Results &mdash; Zapmenot 0.1 documentation</title>
      <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
      <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
  <!--[if lt IE 9]>
    <script src="_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
        <script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
        <script src="_static/jquery.js"></script>
        <script src="_static/underscore.js"></script>
        <script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
        <script src="_static/doctools.js"></script>
        <script src="_static/sphinx_highlight.js"></script>
    <script src="_static/js/theme.js"></script>
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
    <link rel="next" title="We Want Pictures!" href="graphics.html" />
    <link rel="prev" title="Modeling in ZapMeNot" href="modeling.html" /> 
</head>

<body class="wy-body-for-nav"> 
  <div class="wy-grid-for-nav">
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search" >
            <a href="index.html" class="icon icon-home"> Zapmenot
          </a>
              <div class="version">
                0.1
              </div>
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>
        </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
              <ul class="current">
<li class="toctree-l1"><a class="reference internal" href="license.html">Licence &amp; Disclaimer</a></li>
<li class="toctree-l1"><a class="reference internal" href="getting-started.html">Getting Started</a></li>
<li class="toctree-l1"><a class="reference internal" href="materials.html">Material Library</a></li>
<li class="toctree-l1"><a class="reference internal" href="isotopes.html">Isotope Library</a></li>
<li class="toctree-l1"><a class="reference internal" href="modeling.html">Modeling in ZapMeNot</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Generating Results</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#basic-method">Basic Method</a></li>
<li class="toctree-l2"><a class="reference internal" href="#getting-details">Getting Details</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="graphics.html">We Want Pictures!</a></li>
<li class="toctree-l1"><a class="reference internal" href="theory-and-methods.html">Theory and Methods</a></li>
<li class="toctree-l1"><a class="reference internal" href="benchmarks.html">Benchmarking</a></li>
<li class="toctree-l1"><a class="reference internal" href="module-docs.html">Module Contents</a></li>
<li class="toctree-l1"><a class="reference internal" href="developer.html">Developer</a></li>
<li class="toctree-l1"><a class="reference internal" href="version-history.html">Version History</a></li>
</ul>

        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="index.html">Zapmenot</a>
      </nav>

      <div class="wy-nav-content">
        <div class="rst-content">
          <div role="navigation" aria-label="Page navigation">
  <ul class="wy-breadcrumbs">
      <li><a href="index.html" class="icon icon-home"></a></li>
      <li class="breadcrumb-item active">Generating Results</li>
      <li class="wy-breadcrumbs-aside">
            <a href="_sources/results.rst.txt" rel="nofollow"> View page source</a>
      </li>
  </ul>
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
             
  <section id="generating-results">
<h1>Generating Results<a class="headerlink" href="#generating-results" title="Permalink to this heading"></a></h1>
<p>Two approaches are available for calculating dose rates once a ZapMeNot
model has been constructed.</p>
<section id="basic-method">
<h2>Basic Method<a class="headerlink" href="#basic-method" title="Permalink to this heading"></a></h2>
<p>The basic approach is demonstrated in the following code block.  It is
assumed that a model <code class="code docutils literal notranslate"><span class="pre">myModel</span></code> has already been constructed with an appropriate
source and detector.  The method <code class="code docutils literal notranslate"><span class="pre">calculate_exposure</span></code> returns the exposure in mR/hr.</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="c1"># run an existing model</span>
<span class="n">result</span> <span class="o">=</span> <span class="n">myModel</span><span class="o">.</span><span class="n">calculate_exposure</span><span class="p">()</span>
</pre></div>
</div>
</section>
<section id="getting-details">
<h2>Getting Details<a class="headerlink" href="#getting-details" title="Permalink to this heading"></a></h2>
<p>A more detailed exposure report can be generated with the <code class="code docutils literal notranslate"><span class="pre">generate_summary</span></code> method.
<code class="code docutils literal notranslate"><span class="pre">generate_summary</span></code> returns a “list of lists” (think of a group of lists).  The lists
include, in order of appearance, the photon energy groups, the photon appearance in each group
(photons/sec), the total energy flux by group (MeV/sec), total
uncollided exposure by energy group (mR/hr), and total exposure by energy group (mR/hr).  These lists
can be easily accessed in the following manner:</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="c1"># generate a summary from an existing model</span>
<span class="p">(</span><span class="n">energy_groups</span><span class="p">,</span> <span class="n">intensities</span><span class="p">,</span> <span class="n">energy_flux</span><span class="p">,</span>
    <span class="n">uncollided_exposure</span><span class="p">,</span> <span class="n">exposure</span><span class="p">)</span> <span class="o">=</span> <span class="n">myModel</span><span class="o">.</span><span class="n">generate_summary</span><span class="p">()</span>
</pre></div>
</div>
<p>This provides access to the data for further processing.  Alternatively,
Python packages such as <a class="reference external" href="https://pandas.pydata.org">Pandas</a> can provide powerful data analysis tools
that can be used with the results of the <code class="code docutils literal notranslate"><span class="pre">generate_summary</span></code> method.</p>
<p>For example, adding the following line will import the Pandas package:</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span>
</pre></div>
</div>
<p>The following code would generate a formatted table from the output summary:</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="c1"># generate a formatted summary from an existing model</span>
<span class="n">summary</span> <span class="o">=</span> <span class="n">myModel</span><span class="o">.</span><span class="n">generate_summary</span><span class="p">()</span>
<span class="n">df</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">(</span><span class="n">summary</span><span class="p">,</span> <span class="n">columns</span> <span class="o">=</span> <span class="p">[</span><span class="s1">&#39;MeV&#39;</span><span class="p">,</span>
                                      <span class="s1">&#39;photons/sec&#39;</span><span class="p">,</span>
                                      <span class="s1">&#39;Uncollided MeV/cm2/sec&#39;</span><span class="p">,</span>
                                      <span class="s1">&#39;Uncollided mR/hr&#39;</span><span class="p">,</span>
                                      <span class="s1">&#39;Collided mR/hr&#39;</span><span class="p">])</span>
<span class="nb">print</span><span class="p">(</span><span class="n">df</span><span class="p">)</span>
</pre></div>
</div>
<p>A model containing an Ar-41 source with two photons might result in the following output:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>       <span class="n">MeV</span>   <span class="n">photons</span><span class="o">/</span><span class="n">sec</span>  <span class="n">Uncollided</span> <span class="n">MeV</span><span class="o">/</span><span class="n">cm2</span><span class="o">/</span><span class="n">sec</span>  <span class="n">Uncollided</span> <span class="n">mR</span><span class="o">/</span><span class="n">hr</span>  <span class="n">Collided</span> <span class="n">mR</span><span class="o">/</span><span class="n">hr</span>
<span class="mi">0</span>  <span class="mf">1.29364</span>  <span class="mf">2.974800e+10</span>             <span class="mf">1371.119906</span>          <span class="mf">2.382878</span>       <span class="mf">15.887568</span>
<span class="mi">1</span>  <span class="mf">1.67700</span>  <span class="mf">1.546896e+07</span>                <span class="mf">1.768057</span>          <span class="mf">0.002878</span>        <span class="mf">0.015251</span>
</pre></div>
</div>
</section>
</section>


           </div>
          </div>
          <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
        <a href="modeling.html" class="btn btn-neutral float-left" title="Modeling in ZapMeNot" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
        <a href="graphics.html" class="btn btn-neutral float-right" title="We Want Pictures!" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>&#169; Copyright 2019 - 2023, Alan Ford..
      <span class="lastupdated">Last updated on Feb 12, 2023.
      </span></p>
  </div>

  Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
    <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
    provided by <a href="https://readthedocs.org">Read the Docs</a>.
   

</footer>
        </div>
      </div>
    </section>
  </div>
  <script>
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script> 

</body>
</html>